//////////////////////////////////////////////////////////////////////////////
//
//  Created by Philip Mulcahy on 01/03/2013.
//  Copyright (c) 2013 Philip Mulcahy. All rights reserved.
//
//  This file is part of the note-recog library.
//
//  note-recog is free software: you can redistribute it and/or modify
//  it under the terms of version 3 of the GNU Lesser General Public License 
//  as published by the Free Software Foundation.
//
//  note-recog is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with note-recog. If not, see <http://www.gnu.org/licenses/>.
//
//////////////////////////////////////////////////////////////////////////////

#ifndef note_recog_ParametricFrameGenerator_h
#define note_recog_ParametricFrameGenerator_h


#include "IIterable.h"
#include "TimeDomainGenerator.h"
#include <vector>
#include <memory>


class Frame;
class IFrameGenParamGen;


class ParametricFrameGenerator : public IIterable<Frame>
{
private:
    class VecToFrameFunctor
    {
    public:
        Frame operator()(std::vector<short> time_domain);
    };
    const float _samplingFreq;
    IFrameGenParamGen * const _frameGenParamGen;
    TimeDomainGenerator _timeDomain;
    VecToFrameFunctor _vecToFrame;
    
public:
    ParametricFrameGenerator(IFrameGenParamGen*,
                             float samplingFreq,
                             size_t frameSize);
    virtual ~ParametricFrameGenerator();
    virtual Frame next();
    virtual bool hasNext() const;
private:
    ParametricFrameGenerator(); // not implemented
    ParametricFrameGenerator(const ParametricFrameGenerator&); // not implemented
    ParametricFrameGenerator& operator=(const ParametricFrameGenerator&); // not implemented
};


#endif
